local more1__duodao = fk.CreateSkill{
  name = "more1__duodao",
}
Fk:loadTranslationTable{
  ["more1__duodao"] = "夺刀",
  [":more1__duodao"] = "当你被【杀】指定为目标时或受到伤害后，你可以摸一张牌然后获得该【杀】的使用者/伤害来源区域的一张牌（若获得的不是其手牌或未获得牌你额外摸一张牌）",
  ["$more1__duodao1"] = "避其锋芒，夺其兵刃！",
  ["$more1__duodao2"] = "好兵器啊！哈哈哈！",
}

more1__duodao:addEffect(fk.Damaged, {
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(more1__duodao.name) and data.from
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:drawCards(player,1,more1__duodao.name)
    local cards = room:askToChooseCards(player, {
      target = data.from,
      min = 1,
      max = 1,
      flag = "he",
      skill_name = more1__duodao.name,
      cancelable = true,
    })
    if #cards == 0 or not table.find(data.from:getCardIds("h"), function(id)
      return table.contains(cards, id)
    end) then
      room:drawCards(player,1,more1__duodao.name)
    end
    if #cards ~= 0 then 
      room:obtainCard(player, cards, false, fk.ReasonGive, data.from, more1__duodao.name)
    end
  end,
})

more1__duodao:addEffect(fk.TargetConfirmed, {
  can_trigger = function(self, event, target, player, data)
    return target == player and data.card.trueName == "slash" and player:hasSkill(more1__duodao.name) and data.from
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:drawCards(player,1,more1__duodao.name)
    local cards = room:askToChooseCards(player, {
      target = data.from,
      min = 1,
      max = 1,
      flag = "he",
      skill_name = more1__duodao.name,
      cancelable = true,
    })
    if #cards == 0 or not table.find(data.from:getCardIds("h"), function(id)
      return table.contains(cards, id)
    end) then
      room:drawCards(player,1,more1__duodao.name)
    end
    if #cards ~= 0 then 
      room:obtainCard(player, cards, false, fk.ReasonGive, data.from, more1__duodao.name)
    end
  end,
})







return more1__duodao